﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Umbrella.Net.Contracts;
using Umbrella.Net.Web.Database;

public static partial class IUmbrellaServiceExtensionMethods
{

    public static SharePointVersionInfo ToContract(this DbSharePointVersion v)
    {
        return new SharePointVersionInfo()
        {
            BuildNumber = v.BuildNumber,
            VersionString = v.VersionString
        };
    }

    public static SharePointLanguage ToContract(this DbSharePointLanguage l)
    {
        return new SharePointLanguage()
        {
            LCID = l.LCID,
            Title = l.Title,
            ISO = l.ISO,
        };
    }

    public static SharePointInstallationFile ToContract(this DbSharePointInstallationFile l)
    {
        return new SharePointInstallationFile()
        {
            LanguageLCID = l.LanguageLCID,
            Platform = (l.Is64bit ? SharePointPlatform.X64 : SharePointPlatform.X86),
            ProductCode = l.ProductCode,
            ZipDownloadUrl = l.ZipDownloadUrl,
            ZipPassword = l.ZipPassword
        };
    }
}
